<%-- 
    Document   : editProject
    Created on : 11.5.2009, 20:58:46
    Author     : Ediczech
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <%@include file="view/header.jsp" %>

    <%-- Content --%>

    <h2><h:outputText value="#{msg.editProject_title}"/></h2>
    <a4j:form id="editProject" prependId="">

        <h:inputHidden id="id" value="#{ProjectBean.project.id}"/>

        <h:panelGrid columns="3">
            <h:outputText value="#{msg.project_name}:" />
            <h:inputText id="Name" value="#{ProjectBean.project.name}"
                         size="15" required="true">
                <f:validateLength minimum="3" maximum="30"/>
            </h:inputText>
            <h:message for="Name" errorClass="message_error"/>

            <h:outputText value="#{msg.project_version}:" />
            <h:inputText id="Version" value="#{ProjectBean.project.version}"
                         size="15" required="true">
                <f:validateLength maximum="12"/>
            </h:inputText>
            <h:message for="Version" errorClass="message_error"/>

            <h:outputText value="#{msg.project_description}:" />
            <h:inputTextarea id="Description" value="#{ProjectBean.project.description}"
                             rows="3" cols="40" required="true">
                <f:validateLength minimum="10" maximum="200"/>
            </h:inputTextarea>
            <h:message for="Description" errorClass="message_error"/>

            <h:outputText value="#{msg.project_creator}:" />
            <h:outputText value="#{ProjectBean.project.creator.nick}"/>
            <rich:spacer/>

            <h:outputText value="#{msg.project_developers}:" />
            <rich:pickList id="Developers" value="#{ProjectBean.projectDevelopers}" showButtonsLabel="false"
                           listsHeight="100" sourceListWidth="125" targetListWidth="125">
                <f:selectItems  value="#{ProjectBean.developers}"/>
            </rich:pickList>
            <h:message for="Developers" errorClass="message_error"/>
        </h:panelGrid>
        <h:panelGrid>
            <h:messages errorClass="message_error" globalOnly="true"/>
            <h:commandButton action="#{ProjectBean.edit}" value="#{msg.editProject_button}"/>
        </h:panelGrid>
    </a4j:form>

    <%-- Content --%>
    
    <%@include file="view/footer.jsp" %>
</f:view>